<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>简单点</title>
    <link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
    <link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.css" rel="stylesheet">
    <link href="/css/style.css" rel="stylesheet">
    <link href="/css/jquery.Jcrop.css" rel="stylesheet">
    <link href="{!! asset('/assets/css/select2.min.css') !!}">

    <script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script src="/js/jquery.form.js"></script>
    <script src="/js/jquery.Jcrop.min.js"></script>
    <script src="//cdn.bootcss.com/vue/1.0.26/vue.min.js"></script>
    <script src="//cdn.bootcss.com/vue-resource/0.9.3/vue-resource.min.js"></script>
    <script src="{!! asset('/assets/js/select2.full.min.js') !!}"></script>
    <script src="{!! asset('/assets/js/select2.min.js') !!}"></script>
    <meta id="token" name="token" value="{{ csrf_token() }}">
    <meta property="wb:webmaster" content="7183ff2341ac4d80" />
    <meta property="qc:admins" content="644654316152056375" />
</head>
<body>
<nav class="navbar navbar-default navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">简单点</a>
        </div>

        @inject('categories','App\Models\Category')
        @inject('tags','App\Models\Tag')
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="active"><a href="/">首页</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">文章分类<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        @foreach($categories->all() as $category)
                            <li><a href="/?category={{ $category->id }}">{{ $category->name }}</a></li>
                        @endforeach
                        {{--<li role="separator" class="divider"></li>--}}
                        {{--<li class="dropdown-header">Nav header</li>--}}
                        {{--<li><a href="#">Separated link</a></li>--}}
                        {{--<li><a href="#">One more separated link</a></li>--}}
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">文章标签<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        @foreach($tags->all() as $tag)
                            <li><a href="/?tag={{ $tag->id }}">{{ $tag->name }}</a></li>
                        @endforeach
                        {{--<li role="separator" class="divider"></li>--}}
                        {{--<li class="dropdown-header">Nav header</li>--}}
                        {{--<li><a href="#">Separated link</a></li>--}}
                        {{--<li><a href="#">One more separated link</a></li>--}}
                    </ul>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                @if(Auth::check())
                    <li><img src="{{ Auth::user()->avatar }}" alt="" class="img-circle" style="width: 50px"></li>
                    <li>
                        <a href="" class="" data-toggle="dropdown" id="dLabel">{{ Auth::user()->name }}</a>

                        <ul class="dropdown-menu" aria-labelledby="dLabel">
                            <li><a href="/user/avatar"> <i class="fa fa-user"></i> 更换头像</a></li>
                            <li><a href="#"> <i class="fa fa-cog"></i> 更换密码</a></li>
                            <li><a href="#"> <i class="fa fa-heart"></i> 特别感谢</a></li>
                            <li role="separator" class="divider"></li>
                            <li> <a href="/user/logout">  <i class="fa fa-sign-out"></i> 退出登录</a></li>
                        </ul>
                    </li>
                @else
                    <li><a href="/user/login">登 陆</a></li>
                    <li><a href="/user/register">注 册</a></li>
                @endif
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>

@yield('content')
</body>
</html>

@yield('script')